<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('车辆轨迹信息列表')" />
</head>
<style>
    .select-list li p, .select-list li label:not(.radio-box){
        width: 91px;
    }
</style>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>车牌号码：</label>
                                <input type="text" name="carNum"/>
                            </li>
                            <li>
                                <label>车辆开始时间：</label>
                                <input type="text" class="time-input" placeholder="请选择车辆开始时间" name="trailStart"/>
                            </li>
                            <li>
                                <label>预计结束时间：</label>
                                <input type="text" class="time-input" placeholder="请选择预计结束时间" name="trailYujiEnd"/>
                            </li>
                            <li>
                                <label>实际结束时间：</label>
                                <input type="text" class="time-input" placeholder="请选择实际结束时间" name="trailEnd"/>
                            </li>
                            <li>
                                <label>轨迹状态：</label>
                                <select name="isState" th:with="type=${@dict.getType('is_state')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="trail:trail:add">
                    <i class="fa fa-plus"></i> 添加轨迹
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="trail:trail:edit">
                    <i class="fa fa-edit"></i> 修改轨迹
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="trail:trail:remove">
                    <i class="fa fa-remove"></i> 删除轨迹
                </a>
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="trail:trail:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('trail:trail:edit')}]];
        var removeFlag = [[${@permission.hasPermi('trail:trail:remove')}]];
        var isState = [[${@dict.getType('is_state')}]];
        var prefix = ctx + "trail/trail";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "车辆轨迹信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'trailId',
                    title: '轨迹信息ID',
                    visible: false
                },
                {
                    field: 'carNum',
                    title: '车牌号码'
                },
                {
                    field: 'locationStart',
                    title: '车辆起始位置'
                },
                {
                    field: 'locationEnd',
                    title: '车辆终点位置'
                },
                {
                    field: 'trailMassage',
                    title: '轨迹信息',
                    visible: false
                },
                {
                    field: 'trailStart',
                    title: '车辆开始时间'
                },
                {
                    field: 'trailYujiEnd',
                    title: '预计结束时间'
                },
                {
                    field: 'trailEnd',
                    title: '实际结束时间'
                },
                {
                    field: 'isState',
                    title: '轨迹状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(isState, value);
                    }
                },
                {
                    field: 'remark',
                    title: '备注',
                    visible: false
                },
                {
                    field: 'aa',
                    title: '查看轨迹',
                    formatter: function(value, row, index) {
                        return '<a href="javascript:void(0)" onclick="detail(\'' + row.trailId + '\')">' + '查看轨迹' + '</a>';
                    }
                }]
            };
            $.table.init(options);
        });

        /*字典列表-详细*/
        function detail(trailId) {
            var url = prefix + '/detail/' + trailId;
            $.modal.openTab("查看轨迹", url);
        }
    </script>
</body>
</html>